package APE.Flux;

import java.io.*;
import java.net.*;
import java.util.*;



public class ReceptionType extends Thread{
	/**
	 * Serveur
	 */
	public static void main(String[] args) {
		ServerSocket serveur = null;
	    Socket soc = null;
	    String str;
	    int entier;
	    float f1;
	    
	 
	    try {
	      serveur = new ServerSocket(8020);
	      System.out.println("en attente d'une connexion");
	      soc = serveur.accept();
	      InputStream o = soc.getInputStream();
	      ObjectInput s = new ObjectInputStream(o);
	      System.out.println("Connexion de "+soc.getInetAddress());
	      
	      str =  (String) s.readObject();
	      entier = (int) s.readObject();
	      f1 = (float) s.readObject();
	      s.close();
	      System.out.println(str+" "+entier+" "+f1);

	    } catch (Exception e) {
	        System.out.println(e.getMessage());
	        System.out.println("Erreur de serialization");
	        System.exit(1);
	    }
    
	}
}
